package com.test.person;

public class Worker extends Person{
    public Worker(String name) {
        super(name);
    }  //必须实现父类的构造方法
/*
普通类继承了抽象类，必须由子类实现抽象类的抽象方法，否则会报错。除非子类也是抽象类。
 */
    @Override
    public void eat() {
        System.out.println("eat something");  //必须由子类实现抽象方法，除非子类也是抽象类
    }

    @Override
    public void sport() {
        System.out.println("do some sport");
    }

    @Override
    public void learn() {
        System.out.println("learning how to make work faster");
    }
}
